package com.arrayExamples;

import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.locks.AbstractQueuedSynchronizer;

/**
 * Created by yijy on 2018/4/10.
 * 一只青蛙一次可以跳上1级台阶，也可以跳上两级台阶。求该青蛙跳上一个n级台阶总共有多少种跳法
 */
public class SolutionQingwa {

    public static void main(String[] args) {
        int count = 1000;
        SolutionQingwa qingwa = new SolutionQingwa();
        System.out.println(qingwa.method1(2));
    }

    /**
     * 跳第1000台阶有2种方式
     */
    public int method1(int shengyu){
        if(shengyu<=1){
            return shengyu;
        }
        return method1(shengyu-1)+method1(shengyu-2);
    }
}
